home *** CD-ROM | disk | FTP | other *** search
- Path: lrz-muenchen.de!news
- From: watzka@stat.uni-muenchen.de (Kurt Watzka)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Re: Statistically Random Number algorithm
- Date: 18 Mar 1996 21:43:33 GMT
- Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
- Distribution: world
- Message-ID: <4ikle5$1rf@sparcserver.lrz-muenchen.de>
- References: <314D0B67.3C16@psu.edu>
- NNTP-Posting-Host: sun2.lrz-muenchen.de
-
- "Jason A. Soloff" <jas251@psu.edu> writes:
-
- >I am working on a monte carlo simulation program to model some problems
- >in astronomy. One thing I am running into, however, is the problem of
- >the pseudo-random number tables. Does anyone have an algorithm (or
- >code) for a truly statistically random number generator?
-
- A guy from NASA once suggested that it is really simple. All you need
- is a satelite that records the background radiation. You digitize
- that and have a perfectly random sequence of random numbers.
-
- For us mere mortals, the quote from John v. Neumann still holds:
-
- Anyone who considers arithmetical methods of producing
- random digits is, of course, in a state of sin.
-
- So, the answer for C (and C++) still is: Use rand(). If rand() is not
- good enough for you, maybe the random number generators available
- on your system will be a solution.
-
- The word algorithm implies a _deterministic_ process, and there
- cannot be a deterministic process that produces _random_ output.
-
- Kurt
- --
- | Kurt Watzka Phone : +49-89-2180-6254
- | watzka@stat.uni-muenchen.de
- | ua302aa@sunmail.lrz-muenchen.de
-
-